Now we need to count how many times the left arrow key is pressed. Click on the Python tab again to find Data.

All of the commands inside an event should have a green block ···· in front of them and will only run when signalled.

  • Change the variable that comes after the keyword global to left_count.

The keyword global allows us to change the value of a variable inside of an event.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)